package cn.iocoder.yudao.module.aiposter.dal.mysql.submit;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.aiposter.dal.dataobject.submit.SubmitDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.aiposter.controller.app.submit.vo.*;

/**
 * 提交海报信息 Mapper
 *
 * @author Rain
 */
@Mapper
public interface AppSubmitMapper extends BaseMapperX<SubmitDO> {

    default PageResult<SubmitDO> selectPage(AppSubmitPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<SubmitDO>()
                .likeIfPresent(SubmitDO::getBizName, reqVO.getBizName())
                .likeIfPresent(SubmitDO::getKeyword, reqVO.getKeyword())
                .eqIfPresent(SubmitDO::getImage, reqVO.getImage())
                .eqIfPresent(SubmitDO::getPosterIds, reqVO.getPosterIds())
                .betweenIfPresent(SubmitDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(SubmitDO::getId));
    }

}